Imports Clo = Enhancements.Core.Logging
Imports Col = System.Collections
Imports Ref = System.Reflection
Imports Sys = System

Namespace Enhancements.Basic
    ''' <summary>The exception that is thrown when a list contains a certain object.</summary>
    <Serializable(), DebuggerStepThrough()> _
    Public NotInheritable Class IsListContainingException
        Inherits AssertException

        Private Sub New(ByVal _objectName As System.String, ByVal _object As Col.IList, ByVal _object2Name As System.String, ByVal _object2 As System.Object)
            MyBase.New(_objectName)
            [Object] = _object
            Object2Name = _object2Name
            Object2 = _object2
        End Sub

        Private __Object As Col.IList = Nothing
        ''' <summary>Gets the value of the container object that caused this exception.</summary>
        Public Property [Object]() As Col.IList
            Get
                Return __Object
            End Get
            Private Set(ByVal _value As Col.IList)
                __Object = _value
            End Set
        End Property

        Private __Object2Name As System.String = Nothing
        ''' <summary>Gets the name of the contained object that caused this exception.</summary>
        Public Property Object2Name() As System.String
            Get
                Return __Object2Name
            End Get
            Private Set(ByVal _value As System.String)
                __Object2Name = _value
            End Set
        End Property

        Private __Object2 As System.Object = Nothing
        ''' <summary>Gets the value of the contained object that caused this exception.</summary>
        Public Property Object2() As System.Object
            Get
                Return __Object2
            End Get
            Private Set(ByVal _value As System.Object)
                __Object2 = _value
            End Set
        End Property

        ''' <summary>Throws an exception.</summary>
        ''' <param name="_objectName">Name of the container object that is causing the exception.</param>
        ''' <param name="_object">Container object that is causing the exception.</param>
        ''' <param name="_object2Name">Name of the contained object that is causing the exception.</param>
        ''' <param name="_object2">Contained object that is causing the exception.</param>
        ''' <exception cref="IsListContainingException"> </exception>
        Friend Shared Sub ___Throw(ByVal _objectName As System.String, ByVal _object As Col.IList, ByVal _object2Name As System.String, ByVal _object2 As System.Object)
            Dim _exception As IsListContainingException = New IsListContainingException(_objectName, _object, _object2Name, _object2)

            Throw _exception
        End Sub

    End Class
End Namespace
